﻿@using ZhouYu.DreamTour.Web.Models;
@{
    Layout = null;
    var UserInfo = UserInfoContext.userInfoContext.UserInfo;
}
<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>中国梦想游-会员登录页</title>
    <link href="~/css/style.css" rel="stylesheet" type="text/css" />
    <link href="~/css/common.css" rel="stylesheet" type="text/css" />
    <script src="~/js/jquery-1.9.1.min.js"></script>
    <link rel="stylesheet" type="text/css" href="~/layui-v2.5.4/layui/css/modules/layer/default/layer.css">
    <link rel="stylesheet" href="~/css/notiflix-1.3.0.min.css">
    <script type="text/javascript" src="~/js/notiflix-1.3.0.min.js"></script>
    <script src="~/layui-v2.5.4/layui/lay/modules/layer.js"></script>
    <script type="text/javascript" src="~/js/spin.min.js"></script>
    <style>
        #mb {
            display: none;
            height: 100%;
            width: 100%;
            position: fixed;
            *position: absolute;
            *height: 1380px;
            background: black;
            top: 0;
            left: 0;
            opacity: 0.6;
        }
    </style>
</head>
<body>
    <div class="top_hw clearfix">
        <div class="top_h clearfix">
            <div class="top_hl"><span>欢迎来到中国梦想游，让你的梦想全程免费自由行！</span> 预定热线：<b>0571-63322269</b></div>
            <div class="top_hr">
                @if (UserInfo == null)
                {
                    <a href="/Home/User_Register">会员注册</a>
                    <span>|</span> <a href="/Home/User_Login">登录</a>
                    <span>|</span> <a href="#">梦想收藏</a> <span>|</span> <a href="#">设为首页</a>
                    @*<a>
                        欢迎你，来到新世界旅行网！
                    </a>*@
                }
                else
                {
                    <a href="/Home/User_Center">会员中心</a>
                    <span>|</span> <a href="#">梦想收藏</a> <span>|</span> <a href="#">设为首页</a> <span>|</span> <a href="/Login/LoginOut">退出</a> <span>|</span>
                    <a>
                        欢迎你，<span>@UserInfo.User_Name</span>来到新世界旅行网！
                    </a>
                }
            </div>
        </div>
        <div class="head_w">
            <div class="head_t clearfix">
                <div class="logo"><img src="~/images/logo.jpg"></div>
                <div class="rx_line"><img src="~/images/rx.jpg"></div>
            </div>
        </div>
        <div class="mainNav clearfix">
            <ul class="Nav_ul">
                <li><a href="/Home/Index">首页</a><img src="~/images/nav_line.jpg"></li>
                <li><a href="/Home/Route">旅游路线</a><img src="~/images/nav_line.jpg"></li>
                <li><a href="/Home/Scenic">旅游景点</a><img src="~/images/nav_line.jpg"></li>
                <li><a href="/Home/CateringAccommodation">餐饮住宿</a><img src="~/images/nav_line.jpg"></li>
                <li><a href="/Home/Traffic_DatailsOne">交通线路</a><img src="~/images/nav_line.jpg"></li>
                <li><a href="/Home/Group">旅游团购</a><img src="~/images/nav_line.jpg"></li>
                <li><a href="/Home/Specialty">地方特产</a><img src="~/images/nav_line.jpg"></li>
                <li><a href="/Home/AutoGenerationIntro">自动生成简介</a><img src="~/images/nav_line.jpg"></li>
                <li><a href="/Home/Team_About">团队简介</a><img src="~/images/nav_line.jpg"></li>
                <li><a href="/Home/Itinerary_Details">行程导航</a></li>
            </ul>
        </div>
        <div class="b_wrap">
            <div class="current"><span>当前所在地：</span><a href="/Home/Index">首页</a>  >> <a href="/Home/User_Login">会员登录</a></div>
            <div class="login_w clearfix">
                <div class="login">
                    <div class="login_t">会员登录</div>
                    <div class="login_con">
                        <table class="login_tab" width="270" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>登录名：</td>
                                <td><input type="text" id="User_Name" name="" value="" placeholder=""></td>
                            </tr>
                            <tr>
                                <td>密&nbsp;&nbsp;&nbsp;&nbsp;码：</td>
                                <td><input type="password" id="User_Pwd" name="" value="" placeholder=""></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td><input type="checkbox" id="savepwd" name="" value=""> 30天内自动登录</td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td><a class="log_b" id="User_Login">登 录</a> <a class="back_m" href="#">找回密码</a></td>
                            </tr>
                        </table>
                    </div>
                    <div class="login_b">
                        <p>还不是梦想游会员？  <a class="free_zc" href="#">免费注册</a> </p>
                        <p>使用合作网站帐号登录 </p>
                        <p><a class="log_a01" href="#">新浪微博</a> <a class="log_a02" href="#">支付宝</a> <a class="log_a03" href="#">QQ帐号</a></p>
                    </div>
                </div>
            </div>
        </div>
        <div id="Div">
            <div id="firstDiv" style="margin-left:45%"></div>
        </div>
        
</body>
</html>
<div id="mb"></div>
<script>

     //消息弹出层
        Notiflix.Notify.Init();
			Notiflix.Report.Init();
			Notiflix.Confirm.Init();
    Notiflix.Loading.Init({
        clickToClose: true
    });

    $(function () {
        //登录按钮触发事件
        $("#User_Login").click(function () {
            var User_Name = $("#User_Name").val();
            var User_Pwd = $("#User_Pwd").val();
            //密码登录：登录之前判断用户名和密码是否为空
            if (User_Name != "" && User_Pwd != "") {
                var data = {};
                //是否记住密码
                var savePwd = $("#savepwd").prop("checked");
                data.User_IsCheck = savePwd;
                //登录名
                data.User_Name = $("#User_Name").val();
                //登录密码
                data.User_Pwd = $("#User_Pwd").val();
                //ajax提交
                $.ajax({
                    url: "/Login/LoginUserInfo",
                    type: "post",
                    data: data,
                    beforeSend: function () {
                        //异步请求时网络卡顿时遮罩层和转圈圈出现
                        $("#firstDiv").text("加载中请稍后");
                        $("#mb").css("display", "block");
                        $("#firstDiv").show();
                        var target = $("#firstDiv").get(0);
                        spinner.spin(target);
                    },
                    success: function (result) {
                        if (result.Success) {
                            //layer.alert('登录成功！', {
                            //    title: '提示框',
                            //    icon: 1,
                            //});
                            $("#mb").css("display","block");
                            //登录成功则跳转主页                  
                            location.href = "/Home/Index";
                            layer.close(index);
                        }
                        else {
                            //layer.alert('用户名或密码错误！', {
                            //    title: '提示框',
                            //    icon: 0,
                            //});
                            Notiflix.Notify.Warning('用户名或密码错误！', function () {
                                location.reload();

                            });
                        }
                    }
                });
            }
        });


        //opts 可从网站在线制作
        var opts = {
            lines: 13, // 花瓣数目
            length: 15, // 花瓣长度
            width: 5, // 花瓣宽度
            radius: 20, // 花瓣距中心半径
            corners: 1, // 花瓣圆滑度 (0-1)
            rotate: 0, // 花瓣旋转角度
            direction: 1, // 花瓣旋转方向 1: 顺时针, -1: 逆时针
            color: 'gray', // 花瓣颜色
            speed: 1, // 花瓣旋转速度
            trail: 60, // 花瓣旋转时的拖影(百分比)
            shadow: false, // 花瓣是否显示阴影
            hwaccel: false, //spinner 是否启用硬件加速及高速旋转
            className: 'spinner', // spinner css 样式名称
            zIndex: 2e9, // spinner的z轴 (默认是2000000000)
            top: '0%', // spinner 相对父容器Top定位 单位 px
            left: '50%'// spinner 相对父容器Left定位 单位 px
        };
        var spinner = new Spinner(opts);
    });
</script>

